var express = require("express");
var Route = express.Router();
const captchaService = require("../service/captchaService");
const formatRsesponse = require("../utils/responseFormat");

//获取验证码
Route.get("/", async (req, res, next) => {
  const { text, data } = await captchaService();
  req.session.captcha = text;
  res.setHeader("Content-Type", "image/svg+xml");
  res.send(data);
});

module.exports = Route;
